home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / DockExtenders / LaunchPad / Source / AppIconView.m < prev    next >
Text File  |  1993-12-16  |  1KB  |  66 lines

  1. // AppIconView.m
  2.  
  3. /*
  4.  * Copyright 1991 RightBrain Software.  All rights reserved.
  5.  *
  6.  * No part of this code may be reproduced in any form, compiled
  7.  * or source code, nor used for any purpose without the express
  8.  * written permission of RightBrain Software.
  9.  * 
  10.  * Entered into the public domain 12/15/93 by RightBrain Software.
  11.  *
  12.  */
  13.  
  14. #import <objc/List.h>
  15. #import <dpsclient/psops.h>
  16. #import <appkit/NXImage.h>
  17.  
  18. #import "AppIconView.h"
  19.  
  20. @implementation AppIconView
  21.  
  22.  
  23. /* instance methods */
  24.  
  25. - initFrame:(NXRect *)frameRect
  26. {
  27.     [super initFrame:frameRect];
  28.     
  29.   /* construct the image list */
  30.     imageList = [[List alloc] init];
  31.     [imageList addObject:[NXImage findImageNamed:"app"]];
  32.     [imageList addObject:[NXImage findImageNamed:"Acceptor30"]];
  33.     [imageList addObject:[NXImage findImageNamed:"Acceptor60"]];
  34.     [imageList addObject:[NXImage findImageNamed:"Acceptor90"]];
  35.     
  36.     return self;
  37. }
  38.     
  39. - drawImage:(int)imageNumber
  40. {
  41.     currentImage = imageNumber;
  42.     [self display];
  43.     
  44.   /* we do want to wait for our drawing to get flushed to the window server */
  45.     NXPing();
  46.     
  47.     return self;
  48. }
  49.  
  50. - drawSelf:(NXRect *)rects :(int)count
  51. {
  52.     NXPoint    point = {8.0, 8.0};
  53.     
  54.   /* erase */
  55.     PSsetgray(NX_LTGRAY);
  56.     NXRectFill(&bounds);
  57.     
  58.   /* image the right image */
  59.     [[imageList objectAt:currentImage] composite:NX_SOVER
  60.                        toPoint:&point];
  61.  
  62.     return self;
  63. }
  64.  
  65. @end
  66.